import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/js/rem"

import {ElMessage} from "element-plus";
import { get, post,axiosURL } from './assets/js/axios.js'
// Vue.prototype.$get = get
// Vue.prototype.$post = post
// Vue.prototype.$URL = axiosURL

// 全局引入（看了下，按需引入和全局引入，包大小差别不打）
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import * as ElIconModules from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'

import tipsbox from './components/tips.js'
import addoredit from './components/addoredit.js'

const app = createApp(App)
app.use(store)
app.use(router)
app.use(tipsbox);
app.use(addoredit);
app.use(ElementPlus, {
  locale: zhCn,
})
app.config.globalProperties.$ElMessage = ElMessage // 自定义添加
app.config.globalProperties.$get = get // 自定义添加
app.config.globalProperties.$post = post // 自定义添加
app.config.globalProperties.$URL = axiosURL // 自定义添加

Object.keys(ElIconModules).forEach(function (key) {
    app.component(ElIconModules[key].name, ElIconModules[key])
  })

const vm = app.mount('#app')

// createApp(App).use(store).use(router).use(ElementPlus).mount("#app");
